
/**************************************************************************************************/
/*                                    WHO LIST GRID THINGER                                       */
/**************************************************************************************************/

client
	verb
		ResetIdle()
			set hidden = 1
			Status -= src
			Status = Available
			Status += src
			if(!IsMuted()) world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Bot_Color)]'>@Wench</font></b>: [src.key] has returned!"

client
	proc
		UserList()
			while(src)
				// Make them go Idle if they are available.
				if(src.inactivity/10 >= 600 && src.Status == Available && !IsTelnet())
					world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Bot_Color)]'>@Wench</font></b>: [src.key] has gone idle."
					Status -= src
					Status = Idle
					Status += src

				// Count the chatters
				var/Active = Available.len
				var/Chatters = Available.len + Idle.len + Busy.len + Away.len

				winset(src,"LeftChatters","text=\"[Chatters] chatters - [Active] Active:\"")
				winset(src,"RightChatters","text=\"[Chatters] chatters - [Active] Active:\"")

				if(src.Status == Available || src.Typing || src.Status == Idle)
					if(winget(src,"Main.Input","text") != src.Inputted && length(winget(src,"Main.Input","text")) > 2)
						if(src.Status == Idle)
							winset(src,null,"command=ResetIdle")
							world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Bot_Color)]'>@Wench</font></b>: [src.key] has returned."
						src.Inputted = winget(src,"Main.Input","text")
						src.Typing = 1
					else if(src.Status != Idle && Typing)
						Typing = 0

				if(Typing)
					mob.icon_state = "Typing"
				else if(Status == Available)
					mob.icon_state = "Available"
				else if(Status == Idle)
					mob.icon_state = "Idle"
				else if(Status == Away)
					mob.icon_state = "Away"
				else if(Status == Busy)
					mob.icon_state = "Busy"

				src.UpdateWho()
				sleep(5)

		UpdateWho()

			var ChattersList = 1

			//winset(src,"WhoList.WhoGrid","cells=1x[ChattersList]")

			for(var/client/C in Available)
				winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
				winset(src,"WhoList.WhoGrid","style=\"body{color:[C.Grid_Color];font-weight:[C.Font_Weight];font-size:12px;}")
				src<< output(C.mob,"WhoList.WhoGrid")
				ChattersList++

			for(var/client/C in Away)
				winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
				winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
				src<< output(C.mob,"WhoList.WhoGrid")
				ChattersList++

			for(var/client/C in Busy)
				winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
				winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
				src<< output(C.mob,"WhoList.WhoGrid")
				ChattersList++

			for(var/client/C in Idle)
				winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
				winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
				src<< output(C.mob,"WhoList.WhoGrid")
				ChattersList++

			winset(src,"WhoList.WhoGrid","cells=1x[ChattersList-1]")

			/*
				if(C.Status == "Available" || C.Status == "Typing")
					winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
					winset(src,"WhoList.WhoGrid","style=\"body{color:[C.Grid_Color];font-weight:[C.Font_Weight];font-size:12px;}")
					src<<output(C.mob,"WhoList.WhoGrid")
				else if(C.Status == "Busy")
					winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
					winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
					src<<output(C.mob,"WhoList.WhoGrid")
				else if(C.Status == "Away")
					winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
					winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
					src<<output(C.mob,"WhoList.WhoGrid")
				else if(C.Status == "Idle")
					winset(src,"WhoList.WhoGrid","current-cell=1,[ChattersList]")
					winset(src,"WhoList.WhoGrid","style=\"body{color:gray;font-weight:lighter;font-size:12px;}")
					src<<output(C.mob,"WhoList.WhoGrid")
*/
